﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using ShevaEngine.Core.Modules.Graphics;

namespace ShevaEngine.Core.Modules.Models
{
    /// <summary>Sheva geometry.</summary>
    public class ShevaModelGeometry : IndexedPrimitivesDrawCall
    {
        /// <summary>Material description.</summary>
        public ModelMaterialParameters MaterialParameters { get; set; }
        /// <summary>Buffers index.</summary>
        public int BuffersIndex { get; set; }
        /// <summary>The index buffer for this mesh part.</summary>
        [ContentSerializerIgnore]
        public IndexBuffer IndexBuffer { get; set; }
        /// <summary>The vertex buffer for this mesh part.</summary>
        [ContentSerializerIgnore]
        public VertexBuffer VertexBuffer { get; set; }
        /// <summary>Bounding box.</summary>
        public BoundingBox BoundingBox { get; set; }

        /// <summary>
        /// Konstruktor.
        /// </summary>
        public ShevaModelGeometry()
        {
        }

        /// <summary>
        /// Inicializace objektu.
        /// </summary>
        /// <param name="model"></param>
        public void Init(ShevaModel model)
        {
            this.IndexBuffer = model.IndexBuffers[this.BuffersIndex];
            this.VertexBuffer = model.VertexBuffers[this.BuffersIndex];            
        }        
    }
}
